package Demo5;

import java.util.concurrent.atomic.AtomicInteger;

public class Main22 {
    public static void main(String[] args) {
        AtomicInteger integer=new AtomicInteger();
        System.out.println(integer.get());
integer.getAndIncrement();
        System.out.println(integer.get());
        System.out.println(integer.getAndSet(100));
integer.getAndAdd(30);
        System.out.println(integer.get());
        integer.compareAndSet(120,150);
        System.out.println(integer.get());
        integer.compareAndSet(130,200);
        System.out.println(integer.get());
    }
}
